package com.ruoyi.quartz.task;

import com.ruoyi.gams.mapper.GamsUserQueueMapper;
import com.ruoyi.gams.mapper.GamsWindowTextMapper;
import com.ruoyi.gams.service.IGamsWindowScreenService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时任务调度测试
 *
 * @author ruoyi
 */
@Component("gamsTask")
@Slf4j
public class GamsTask
{

    @Autowired
    private GamsUserQueueMapper userQueueMapper;

    @Autowired
    private GamsWindowTextMapper windowTextMapper;

    @Autowired
    private IGamsWindowScreenService windowScreenService;

    //过期所有未完成的号码
    public void expireUserQueue()
    {
        userQueueMapper.expireUserQueue();
    }

    //还原默认的窗口文字
    public void revertDefaultWindowText()
    {
        log.info("还原默认的窗口文字");
        windowTextMapper.revertDefaultWindowText();
    }
    //每小时更新最新的控制卡信息
    public void updateScreenInfo()
    {
        log.info("每小时更新最新的控制卡信息");
        windowScreenService.updateScreenInfo();
    }
}
